<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "sms".
 *
 * @property int $id
 * @property string $mobile 手机号
 * @property int $code 短信验证码
 * @property int $status 状态
 * @property int $expired_at 过期时间
 * @property int $created_at 发送时间
 */
class Sms extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'sms';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['mobile', 'code', 'expired_at', 'created_at'], 'required'],
            [['code', 'expired_at', 'created_at'], 'integer'],
            [['mobile'], 'string', 'max' => 11],
            [['status'], 'string', 'max' => 4],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'mobile' => '手机号',
            'code' => '短信验证码',
            'status' => '状态',
            'expired_at' => '过期时间',
            'created_at' => '发送时间',
        ];
    }
}
